// ActionScript file
[Bindable]
public var flags:Array=[{name:"Allemagne", id:"de"}, {name:"Autriche", id:"at"}, {name:"Belgique", id:"be"}, {name:"Canada", id:"ca"}, {name:"Danemark", id:"dk"}, {name:"Espagne", id:"es"}, {name:"Etats-Unis", id:"us"}, {name:"Europe", id:"eu"}, {name:"Finlande", id:"fi"}, {name:"France", id:"fr"}, {name:"Grèce", id:"gr"}, {name:"Hongrie", id:"hu"}, {name:"Irlande", id:"ie"}, {name:"Israël", id:"il"}, {name:"Italie", id:"it"}, {name:"Luxembroug", id:"lu"}, {name:"Norvège", id:"no"}, {name:"Pays-Bas", id:"nl"}, {name:"Polande", id:"po"}, {name:"Portugal", id:"pt"}, {name:"République tchèque", id:"cz"}, {name:"Roumanie", id:"ro"}, {name:"Royaume-Uni", id:"uk"}, {name:"Russie", id:"ru"}, {name:"Slovaquie", id:"sk"}, {name:"Suède", id:"sv"}, {name:"Suisse", id:"ch"}, {name:"Autre", id:"wo"}];

public function genererCodeBrackets():void
{
    var result:String="";

    // Génération de l'introduction
    if (cbIntro.selected)
    {
        result+="<p align=\"justify\">";
        result+=textIntro.text;
        result+="</p>\r\n";
    }

    // Génération des brackets

    result+="<p>\r\n";
    result+="<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\">\r\n";
    result+="    <tbody>\r\n";
    result+="        <tr>\r\n";

    if (rb16.selected)
    {
        result+="            <td nowrap=\"nowrap\" width=\"14%\" bgcolor=\"#000000\" align=\"center\">\r\n";
        result+="            <div align=\"center\"><font face=\"Times New Roman\" size=\"2\" color=\"#ffffff\"><strong>1/8 </strong></font></div>\r\n";
        result+="            </td>\r\n";
        result+="            <td nowrap=\"nowrap\" width=\"14%\" bgcolor=\"#000000\" align=\"center\">\r\n";
        result+="            <div align=\"center\"><font face=\"Times New Roman\" size=\"2\" color=\"#ffffff\"><strong>1/4</strong></font></div>\r\n";
        result+="            </td>\r\n";
        result+="            <td nowrap=\"nowrap\" width=\"14%\" bgcolor=\"#000000\" align=\"center\"><font face=\"Times New Roman\" size=\"2\" color=\"#ffffff\"><strong>1/2</strong></font></td>\r\n";
        result+="            <td nowrap=\"nowrap\" width=\"14%\" bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><font size=\"2\"><font face=\"Times New Roman\"><strong>Finale</strong></font></font></font></td>\r\n";
        result+="            <td nowrap=\"nowrap\" width=\"14%\" bgcolor=\"#000000\" align=\"center\">\r\n";
        result+="            <div align=\"center\"><font face=\"Times New Roman\" size=\"2\" color=\"#ffffff\"><strong>Vainqueur WB</strong></font></div>\r\n";
        result+="            </td>\r\n";
        result+="        </tr>\r\n";
        // Ligne 1
        result+="        <tr>\r\n";
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 2 (première équipe)
        result+="        <tr>\r\n";
        result+=equipe(0);
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 3
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 4
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 5
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 6
        result+="        <tr>\r\n";
        result+=equipe(1);
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 7
        result+="        <tr>\r\n";
        result+=w();
        result+=g();
        result+=d();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 8
        result+="        <tr>\r\n";
        result+=equipe(2);
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 9
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 10
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 11
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 12
        result+="        <tr>\r\n";
        result+=equipe(3);
        result+=w();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 13
        result+="        <tr>\r\n";
        result+=w();
        result+=w();
        result+=g();
        result+=d();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 14 zoo
        result+="        <tr>\r\n";
        result+=equipe(4);
        result+=w();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 15
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 16
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 17
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 18 booya
        result+="        <tr>\r\n";
        result+=equipe(5);
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 19
        result+="        <tr>\r\n";
        result+=w();
        result+=g();
        result+=d();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 20 defcom
        result+="        <tr>\r\n";
        result+=equipe(6);
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 21
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 22
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 23
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 24 forze
        result+="        <tr>\r\n";
        result+=equipe(7);
        result+=w();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";

        //------------------------------------------
        // Ligne 25
        result+="        <tr>\r\n";
        result+=w();
        result+=w();
        result+=w();
        result+=g();
        result+=d();
        result+="        </tr>\r\n";
        //------------------------------------------
        // Ligne 24 beeswax
        result+="        <tr>\r\n";
        result+=equipe(8);
        result+=w();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 23
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 22
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 21
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 20 kick
        result+="        <tr>\r\n";
        result+=equipe(9);
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 19
        result+="        <tr>\r\n";
        result+=w();
        result+=g();
        result+=d();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 18 eindbazen
        result+="        <tr>\r\n";
        result+=equipe(10);
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 17
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 16
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 15
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 14 Rush3d
        result+="        <tr>\r\n";
        result+=equipe(11);
        result+=w();
        result+=g();
        result+=g();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 13
        result+="        <tr>\r\n";
        result+=w();
        result+=w();
        result+=g();
        result+=d();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 12 GIAL
        result+="        <tr>\r\n";
        result+=equipe(12);
        result+=w();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 11
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 10
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 9
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 8
        result+="        <tr>\r\n";
        result+=equipe(13);
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 7
        result+="        <tr>\r\n";
        result+=w();
        result+=g();
        result+=d();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 6
        result+="        <tr>\r\n";
        result+=equipe(14);
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 5
        result+="        <tr>\r\n";
        result+=g();
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 4
        result+="        <tr>\r\n";
        result+=g();
        result+=d();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 3
        result+="        <tr>\r\n";
        result+=g();
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";
        // Ligne 2 (dernière équipe)
        result+="        <tr>\r\n";
        result+=equipe(15);
        result+=w();
        result+=w();
        result+=w();
        result+=w();
        result+="        </tr>\r\n";

        if (cbLower.selected)
        {
            result+="<p>&nbsp;</p>\r\n";
            result+="<p>\r\n";
            result+="<table width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" align=\"center\">\r\n";
            result+="    <tbody>\r\n";
            result+="        <tr>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Tour 3 </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Tour 4 </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Tour 5 </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Tour 6 </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Tour 7 </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Finale LB </strong></font></td>\r\n";
            result+="            <td bgcolor=\"#000000\" align=\"center\"><font color=\"#ffffff\"><strong>Vainqueur LB</strong></font></td>\r\n";
            result+="        </tr>\r\n";

            // Ligne 1 blanche
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 2
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=ld();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 3
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 4
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=ld();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 5
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 6
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 7
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 8
            result+="        <tr>\r\n";
            result+=lw();
            result+=ld();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 9
            result+="        <tr>\r\n";
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 10
            result+="        <tr>\r\n";
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lg();
            result+=ld();
            result+="        </tr>\r\n";

            // Ligne 11
            result+="        <tr>\r\n";
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 12
            result+="        <tr>\r\n";
            result+=lg();
            result+=ld();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 13
            result+="        <tr>\r\n";
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 14
            result+="        <tr>\r\n";
            result+=ld();
            result+=lw();
            result+=lg();
            result+=ld();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 15
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 16
            result+="        <tr>\r\n";
            result+=lw();
            result+=ld();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 17
            result+="        <tr>\r\n";
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 18
            result+="        <tr>\r\n";
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lg();
            result+=ld();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 19
            result+="        <tr>\r\n";
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 20
            result+="        <tr>\r\n";
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 21
            result+="        <tr>\r\n";
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 22
            result+="        <tr>\r\n";
            result+=ld();
            result+=lw();
            result+=lw();
            result+=ld();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 23
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 24
            result+="        <tr>\r\n";
            result+=lw();
            result+=ld();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 25
            result+="        <tr>\r\n";
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 26
            result+="        <tr>\r\n";
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 27
            result+="        <tr>\r\n";
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 28
            result+="        <tr>\r\n";
            result+=lg();
            result+=ld();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 29
            result+="        <tr>\r\n";
            result+=lg();
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 30
            result+="        <tr>\r\n";
            result+=ld();
            result+=lw();
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 31
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 32
            result+="        <tr>\r\n";
            result+=lw();
            result+=ld();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 33
            result+="        <tr>\r\n";
            result+=lw();
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 34
            result+="        <tr>\r\n";
            result+=ld();
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 35
            result+="        <tr>\r\n";
            result+=lg();
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 36
            result+="        <tr>\r\n";
            result+=lg();
            result+=ld();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 37
            result+="        <tr>\r\n";
            result+=lg();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 38
            result+="        <tr>\r\n";
            result+=ld();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

            // Ligne 39
            result+="        <tr>\r\n";
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+=lw();
            result+="        </tr>\r\n";

        }

    }

    result+="    </tbody>"
    result+="</table>"
    result+="</p>"

    // Génération de l'outroduction
    if (cbOutro.selected)
    {
        result+="<p align=\"justify\">";
        result+=textOutro.text;
        result+="</p>\r\n";
    }

    // Génération de la source
    if (!source0.selected == true)
    {
        result+="<p>&nbsp;</p>\n";
        result+="<p align=\"center\">Sources : ";

        result+="<a class=\"news\" target=\"_blank\" href=\"";
        result+=urlSource1.text;
        result+="\">";
        result+=textSource1.text;
        result+="</a>";

        if (source2.selected == true || source3.selected == true)
        {
            result+=", <a class=\"news\" target=\"_blank\" href=\"";
            result+=urlSource2.text;
            result+="\">";
            result+=textSource2.text;
            result+="</a>";
        }

        if (source3.selected == true)
        {
            result+=", <a class=\"news\" target=\"_blank\" href=\"";
            result+=urlSource3.text;
            result+="\">";
            result+=textSource3.text;
            result+="</a>";
        }

        result+="</p>\r\n";
    }

    System.setClipboard(result);
    Alert.show("Le code a été généré et copié dans le presse-papier.", "Génération terminée", Alert.OK);
}

public function w():String
{
    return "<td width=\"14%\" bgcolor=\"" + cp1.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function g():String
{
    return "<td width=\"14%\" bgcolor=\"" + cp2.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function d():String
{
    return "<td width=\"14%\" bgcolor=\"" + cp3.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function equipe(num:int):String
{
    return "<td bgcolor=\"" + cp3.selectedColor.toString(16) + "\"><strong><img alt=\"\" src=\"/fckeditor/editor/../../templates/vakarm/lang/images/mini" + teamsBrackets[num].flag + ".gif\"/> " + teamsBrackets[num].name + "</strong></td>";
}

public function lw():String
{
    return "<td bgcolor=\"" + cp1.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function lg():String
{
    return "<td bgcolor=\"" + cp2.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function ld():String
{
    return "<td bgcolor=\"" + cp3.selectedColor.toString(16) + "\">&nbsp;</td>\r\n";
}

public function genererCodeLineup():void
{
    var result:String="";

    // Génération de l'introduction
    if (cbIntro.selected)
    {
        result+="<p align=\"justify\">";
        result+=textIntro.text;
        result+="</p>\r\n";
    }

    // Génération de la phrase
    if (inputAvantLineup.text.length > 0)
    {
        result+="<p>" + inputAvantLineup.text + "</p>\r\n";
    }

    result+="<blockquote>\r\n";
    result+="<p class=\"palmares\">";

    // Génération de la line-up
    for (var i:int=0; i < dataLineup.length; i++)
    {
        if ((dataLineup.getItemAt(i)as Player).getType() == "Ligne blanche")
        {
            result+="<span class=\"lien_news\">&nbsp;</span>";
        }
        else
        {
            result+="<span class=\"lien_news\"><img alt=\"\" src=\"/fckeditor/editor/../../templates/vakarm/lang/images/mini";
            result+=(dataLineup.getItemAt(i)as Player).getFlag();
            result+=".gif\" /> ";
            result+=(dataLineup.getItemAt(i)as Player).getFirstName();
            result+=" &quot;<strong>";
            result+=(dataLineup.getItemAt(i)as Player).getNickName();
            result+="</strong>&quot; ";
            result+=(dataLineup.getItemAt(i)as Player).getLastName();
            result+="</span>";
            switch ((dataLineup.getItemAt(i)as Player).getType())
            {
                case "Leader":
                    result+=" (leader)";
                    break;
                case "Lead in game":
                    result+=" (lig)";
                    break;
                case "Manager":
                    result+=" (M)";
                    break;
                case "Remplaçant":
                    result+=" (R)";
                    break;
                default:
            }
        }
        result+="<br />\r\n";
    }

    result+="</p></blockquote>\r\n";

    // Génération de l'outroduction
    if (cbOutro.selected)
    {
        result+="<p align=\"justify\">";
        result+=textOutro.text;
        result+="</p>\r\n";
    }

    // Génération de la source
    if (!source0.selected == true)
    {
        result+="<p>&nbsp;</p>\n";
        result+="<p align=\"center\">Sources : ";

        result+="<a class=\"news\" target=\"_blank\" href=\"";
        result+=urlSource1.text;
        result+="\">";
        result+=textSource1.text;
        result+="</a>";

        if (source2.selected == true || source3.selected == true)
        {
            result+=", <a class=\"news\" target=\"_blank\" href=\"";
            result+=urlSource2.text;
            result+="\">";
            result+=textSource2.text;
            result+="</a>";
        }

        if (source3.selected == true)
        {
            result+=", <a class=\"news\" target=\"_blank\" href=\"";
            result+=urlSource3.text;
            result+="\">";
            result+=textSource3.text;
            result+="</a>";
        }

        result+="</p>\r\n";
    }

    System.setClipboard(result);
    Alert.show("Le code a été généré et copié dans le presse-papier.", "Génération terminée", Alert.OK);
}